package com.helloniu.red5.adm;

import java.util.Hashtable;

import com.helloniu.red5.info.ConferenceInfo;

public class ConferenceManager {
	private static ConferenceManager conferenceManager = new ConferenceManager();
	private ConferenceManager() {		
	}

	public static ConferenceManager getInstance() {		
		return conferenceManager;
	}

	public void addConference(String confID) {
		ConferenceInfo confInfo = createConference(confID);
		confInfos.put(confID, confInfo);
	}
	
	public void removeConference(String confID) {
		confInfos.remove(confID);
	}
	
	public ConferenceInfo getConference(String confID) {		
		return confInfos.get(confID);
	}

	private ConferenceInfo createConference(String confID) {
		ConferenceInfo confInfo = new ConferenceInfo(confID);
		return confInfo;
	}

	// LRU FIFO?
	private Hashtable<String, ConferenceInfo> confInfos = 
		new Hashtable<String, ConferenceInfo>();
}
